package cn.edu.tju.elm.service.impl;

import cn.edu.tju.elm.mapper.ProductMapper;
import cn.edu.tju.core.model.Product;
import cn.edu.tju.elm.service.ProductService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService {

    @Override
    public List<Product> getProductsByMerchantId(Integer merchantId) {
        QueryWrapper<Product> qw = new QueryWrapper<>();
        qw.eq("merchant_id", merchantId);
        return this.list(qw);
    }
}
